home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / BARNET / FREENET / JENKIN / 023C / 023c / !Ticker / Source (.txt) < prev    next >
RISC OS BBC BASIC V Source  |  1998-09-19  |  20KB  |  919 lines

  1.  connect status :
  2.  0 = not connected
  3.  1 = trying
  4.  2 = *** reserved ***
  5.  +-2.5 waiting for confirmation of connect
  6.  3 = connected
  7.  +- 3.5 = download initiated
  8.  4 = downloaded
  9.  5 = ticking (on/off)
  10.  y% 8
  11.  y%!0=&4AF80:y%!4=&400C1
  12.  "Wimp_Initialise",310,&4B534154,"Ticker",y% 
  13.  ,task%
  14. close:
  15. $+" code "+
  16.  "Hourglass_Smash":
  17.  "OS_ReadMonotonicTime" 
  18.  time%
  19.  "Wimp_ReadSysInfo",7 
  20.  wimp
  21.  wimp>=350 
  22.  wimp=
  23.  wimp=
  24.  connectstatus=1
  25.  mtresolv 
  26.  FIRSTGO 
  27. open_resolver_window
  28.  dragging 
  29.  inwindow 
  30. colourchange
  31.  connectstatus>=4 
  32.  headlineget 
  33. init_sockets:connectstatus=1
  34.  connectstatus 
  35. ,     
  36.  (toggle 
  37.  dragging) 
  38.      
  39. firstone
  40.      
  41.  3.5:
  42. threepointfive
  43.      
  44. httpget
  45.      
  46.  2.5:
  47. connect
  48.      
  49. resolve
  50.  "OS_ReadMonotonicTime" 
  51.  newtime%
  52.  (newtime%-time% > update*6000 
  53. sysvar("Ticker$Update")) 
  54.  (toggle 
  55.  sleep) 
  56.  updateonoff 
  57. ticker_update
  58.  quit%
  59. close
  60. httpget
  61.  ptr%,flags%, request$, file$
  62.  headlineget 
  63.  file$="headline" 
  64.  file$="story2"
  65. .8   request$="GET /tickerdata/"+file$+".dat HTTP/1.0"
  66. /[   
  67.  proxyonoff 
  68.  request$="GET http://www.bbc.co.uk/tickerdata/"+file$+".dat HTTP/1.0"
  69.  "XSocket_Write",socket%!0,request$+
  70. (request$)+4 
  71. ptr%;flags%
  72.  (ptr%=0 
  73.  (flags% 
  74. 1)=1) 
  75.  !ptr% <> 36 
  76. 2U            connecterror=
  77. :error$="Failed to connect to server":connectstatus=4:
  78. connectstatus=3.5
  79.  at 0 in output file
  80. ("<ticker$dir>."+file$)
  81. output=
  82. output_pos=0
  83. length=0
  84. ;"    a=
  85. ("<ticker$dir>."+file$)
  86. resolve
  87.  status,ptr%,flags%
  88. host$="www.bbc.co.uk"
  89.  proxyonoff 
  90.  host$=$(proxyhost%)
  91.  mtresolv 
  92.  &66000,0,host$ 
  93. ,ptr%,flags%
  94.  ptr%=0 
  95.  (flags% 
  96.  1)=1 
  97.  connecterror=
  98. :error$="Resolving address failed":connectstatus=4:
  99. F& ip%=!!(ptr%!16):connectstatus=2.5
  100.  &46001,host$ 
  101.  status,ptr%;flags%
  102.  (flags% 
  103.  (status <> 36) 
  104.      
  105.  ptr%=0 
  106.  (flags% 
  107.  1)=1 
  108.  connecterror=
  109. :error$="Resolving address failed":connectstatus=4:b%!0=resolver%:
  110.  "Wimp_CloseWindow",,b%:
  111. K/   b%!0=resolver%:
  112.  "Wimp_CloseWindow",,b%
  113. L(   ip%=!!(ptr%!16):connectstatus=2.5
  114. connect
  115.  ptr%,flags%
  116. host$="www.bbc.co.uk"
  117. port=80 
  118.  &FFFF
  119.  proxyonoff 
  120.    host$=$(proxyhost%)
  121. W$   port=
  122. ($(proxyport%)) 
  123.  &FFFF
  124.  right lets try to connect
  125. ZJb%!0=2 
  126.  ((port 
  127. 256)<<16) 
  128.  ((port 
  129. 256)<<24):b%!4=ip%:b%!8=0:b%!12=0
  130.  "XSocket_Connect",socket%!0,b%,16 
  131.  ptr%;flags%
  132.  (flags% 
  133.  1)=1 
  134.  !ptr% 
  135. ^.     
  136.  36:connectstatus=2.5:connecterror=
  137. _.     
  138.  37:connectstatus=2.5:connecterror=
  139. `)     
  140.  56:connectstatus=3:
  141.  beep 
  142.      
  143. bB        connecterror=
  144. :error$=
  145. string0(ptr%+4):connectstatus=4
  146. cD        
  147.  error$="Invalid argument" 
  148.  error$="Connection failed"
  149. addnewicon
  150. iE                   
  151.  (clickerror 
  152.  connecterror) 
  153. readfile
  154.                    
  155.  clickerror 
  156.  connecterror 
  157.  a$="  
  158.   "+error$+".  See help file for troubleshooting.":clickerror=
  159. :clickable(i+1)=
  160. k0                   
  161. updateicon((i+1)
  162. 7,a$,0)
  163. l,                   current=(current+1)
  164.       
  165.  i=0 
  166.          b%!0=main%:b%!4=i
  167. r'         
  168.  "Wimp_GetIconState",,b%
  169.          
  170.  b%!16>132 
  171. t+            x=b%!8-speed:xx=b%!16-speed
  172.             
  173.  x<132 
  174.  x=132
  175. v             
  176.  xx<132 
  177.  x=132
  178. w>             
  179.    SYS "Wimp_ResizeIcon",main%,i,x,-49,xx,-3
  180. x+               
  181.  "Wimp_DeleteIcon",,b%
  182. y.                b%!4=main%:b%!8=x:b%!16=xx
  183. z-               
  184.  "Wimp_CreateIcon",,b%+4
  185. {>                
  186.  i=current 
  187.  xx<windowwidth 
  188. addnewicon
  189.          
  190.       
  191.  "Wimp_BlockCopy",main%,132+speed,-49,windowwidth+speed,-3,132,-49
  192. threepointfive
  193.  mustget
  194. =    
  195.  "XSocket_Read",socket%!0,buffer%,2048 
  196.  len;flags%
  197. #    
  198.  len 
  199.  ((flags% 
  200. 1)=1) 
  201.  stuff in buffer
  202.      d=0
  203.        
  204.         a$=""
  205.          
  206.           a$+=
  207.  buffer%?d
  208.           d+=1
  209. >         
  210.  buffer%?(d-1) = 10 
  211.  buffer%?(d-1) = 13 
  212.  d=len
  213. +        
  214. a$,9)="BBCONLINE" 
  215.  output=
  216.          
  217. a$,7)="REFRESH" 
  218.                 b=
  219.                 a$=
  220. a$,b-1)
  221. 2                
  222.  $(headline%(8))<> 
  223. a$,b-9) 
  224.                 mustget=
  225. ,                $(headline%(8))=
  226. a$,b-9)
  227.                  
  228. save_config
  229.                 
  230.                 a$+=
  231.         
  232. )        
  233. a$,15)="Content-Length:" 
  234.                 b=
  235.                 a$=
  236. a$,b-1)
  237. '                length=
  238. a$,b-16))
  239.         
  240.             
  241.  output 
  242.                
  243. #a=output_pos
  244.               
  245. #a,a$;
  246.                output_pos=
  247. 4                  
  248.  length=output_pos 
  249.  length 
  250.                      
  251. V                      
  252.  headlineget 
  253.  length <1000 
  254.  headlineget=
  255. load_headlines
  256. )                      connectstatus=4
  257. :                      
  258.  "Socket_Shutdown",socket%!0,2
  259. 8                      
  260.  FIRSTGO 
  261.  connectstatus+=1
  262. ,                      
  263.  toggle 
  264. toggle
  265.                   
  266.             
  267.        
  268.  d=len
  269.         
  270.  mustget 
  271.  headlineget=
  272. firstone
  273.  get first icon data
  274.  connecterror 
  275. readfile 
  276.  a$="  "
  277.  plot that first one
  278. getmodeinfo
  279. updateicon(0,a$,windowwidth-154)
  280.  connectstatus=5
  281.  FIRSTGO=
  282. readfile
  283.  x1$, x2$
  284. ("<ticker$dir>.story2")
  285. extent=
  286. #y1=position
  287.   x1$=
  288.   x1=
  289.  x1=extent 
  290.  position=0 
  291.  position=x1
  292. x1$,5)="STORY" 
  293.  channel(
  294. x1$,1)))
  295.  x1=extent 
  296. #y1=0
  297.   x1$=
  298.  x1>11
  299. x1$="  
  300. x1$,x1-9)
  301.   x1=
  302.  x1=extent 
  303.  position=0 
  304.  position=x1
  305.   x2$=
  306.  x2$ <10 
  307.  clickable((i+1)
  308.  clickable((i+1)
  309. updateicon(number,text$,add)
  310.  before,bwidth
  311.  ** calculate width of icon **
  312.  wimp 
  313.  "Wimp_TextOp",1,text$,0 
  314.  width 
  315.  width=
  316.  text$*16
  317.  ** where is the icon before?
  318. before=(number+6)
  319. b%!0=main%:b%!4=before
  320.  "Wimp_GetIconState",,b%
  321. bwidth=b%!16
  322. b%!0=main%:b%!4=number
  323.  "Wimp_GetIconState",,b%
  324.  "Wimp_DeleteIcon",,b%
  325. 7  b%!4=main%:b%!8=bwidth+add:b%!16=bwidth+width+add
  326.  "Wimp_CreateIcon",,b%+4
  327.   SYS "Wimp_ResizeIcon",main%,number,bwidth+add,-49,bwidth+width+add,-3
  328. $(message%(number))=a$
  329. )b%!0=main%:b%!4=number:b%!8=0:b%!12=0
  330.  "Wimp_SetIconState",,b%
  331. close
  332.  "Wimp_CloseDown",task%,&4B534154
  333. "unset ticker$running"
  334. "unset ticker$Update"
  335.  "Wimp_Poll",,b% 
  336. windowopen
  337.  "Wimp_CloseWindow",,b%
  338.  b%!0=main% 
  339.  inwindow=
  340. makeblack(blue):blue=7
  341.  b%!0=main% 
  342.  inwindow=
  343. mouseclick
  344. processkey(b%!0,b%!4,b%!24)
  345. menuclick
  346.  17,18,19:
  347. receive(r%,b%)
  348. depressed 
  349.  dragging=
  350. userdrag
  351. depressed
  352.  data
  353.  "Wimp_GetPointerInfo",,b%
  354. data=b%!8
  355.  data/2 <> 
  356. (data/2) 
  357.  data=
  358.  data=
  359.     =data
  360. userdrag
  361. b%!0=main%
  362.  "Wimp_GetWindowState",,b%
  363. windowwidth=b%!12-b%!4
  364. processkey(win,ico,key)
  365.  "Wimp_ProcessKey",key
  366. windowopen
  367.  !b%=main% 
  368.  modechanging 
  369. getmodeinfo 
  370.  "Wimp_OpenWindow",,b%
  371. receive(u,t%)
  372.  t%!16 
  373.  0:quit%=
  374.  &400C1
  375.      modechanging=
  376.  &4AF80
  377.      
  378.  u<>19 
  379. .     
  380.  now try and load prog to launch url
  381. >     
  382.  "XOS_ReadVarVal","Alias$URLOpen_HTTP",b%,256 
  383.       
  384.  u = 0 
  385.              clickerror=
  386. !O             error$="No Application has been seen that can launch this URL"
  387.       
  388. #.             $b%="URLOpen_HTTP "+launched$
  389. $'             
  390.  "Wimp_StartTask",b%
  391.       
  392. dragging=
  393. headlineget=
  394. toggle=
  395.  clickable(7)
  396. inwindow=
  397. blue=7
  398. modechanging=
  399. FIRSTGO=
  400. output=
  401.  socket% &10
  402.  headline%(8)
  403.  buffer% 2048
  404. connectstatus=0
  405. clickerror=
  406. connecterror=
  407. position=0
  408. current=0
  409.  b% 2048, menspc% 512, ws% 3072
  410.  message%(6)
  411.  channel(8)
  412. wsend%=ws%+3072
  413. quit%=
  414. connected=
  415. load_templates
  416. load_config
  417. ticker_menu
  418. attach(tickermenu%,0,infobox%)
  419. test_resolver
  420. init_sockets
  421. getmodeinfo
  422. test_resolver
  423.  ptr%,flags%
  424.  "XOS_Module",18,"Resolver" 
  425.  ,,,ptr%;flags%
  426.  (flags% 
  427.  mtresolv=
  428.  mtresolv=
  429. getmodeinfo
  430.  height%
  431. modechanging=
  432.  "OS_ReadModeVariable",-1,11 
  433.  ,,modewidth
  434.  "OS_ReadModeVariable",-1,12 
  435.  ,,modeheight
  436. modewidth+=1:modeheight+=1
  437.  connectstatus 
  438. !b%=main%
  439. X, b%!0=main%:
  440.  "Wimp_GetWindowState",,b%
  441. Y2 b%!4=leftwindow:b%!16=topwindow:b%!8=b%!16-52
  442.  b%!12=b%!4+windowwidth
  443.  b%!12>modewidth*2 
  444.  b%!12=modewidth*2:windowwidth=b%!12-b%!4
  445.  toggle 
  446.  b%!12=b%!4+132
  447.  autoadjust 
  448.     windowwidth=modewidth*2
  449. _-    
  450.  windowwidth>3500 
  451.  windowwidth=3500
  452. `+    
  453.  windowwidth<500 
  454.  windowwidth=500
  455.     height=modeheight*2
  456.  iconbar 
  457.  height=188
  458. c<    b%!4=0:b%!8=height-52:b%!12=windowwidth:b%!16=height
  459.  toggle 
  460.  b%!12=132
  461.  "Wimp_OpenWindow",,b%
  462. toggle
  463.  toggle 
  464.     toggle=
  465.    toggle=
  466.    !b%=main%
  467. q#   
  468.  "Wimp_GetWindowState",,b%
  469.  toggle 
  470.    b%!12=b%!4+132
  471.    b%!12=b%!4+windowwidth
  472.  "Wimp_OpenWindow",,b%
  473. init_sockets
  474.  create a new socket for use, internet, stream
  475.  "Socket_Creat",2,1,0 
  476.  socket%!0
  477. !b%=-1
  478.  "Socket_Ioctl",socket%!0,&8004667E,b%
  479. load_config
  480.  a, b, r$
  481. ("<ticker$dir>.choices")
  482.    r$=
  483.    speed=
  484. (r$)*2
  485.    tempspeed=speed
  486.    $(speed%)=
  487. (speed*2)
  488.    updateonoff=
  489.    sleep=
  490.  updateonoff 
  491. iconstate(config%,7,1)
  492.  sleep 
  493. iconstate(config%,32,1)   
  494.    r$=
  495.    update=
  496.    tempupdate=update
  497. -   $(update%)="Every "+
  498. (update)+" mins."
  499.  b=1 
  500.    r$=
  501.     channel(b)=
  502. 1    
  503.  channel(b) 
  504. iconstate(config%,b+11,1)
  505.    windowwidth=
  506.  windowwidth<500 
  507.  windowwidth=500
  508.  windowwidth>3500 
  509.  windowwidth=3500
  510.    $(proxyhost%)=
  511.    temphost$=$(proxyhost%)
  512.    $(proxyport%)=
  513.     tempport=
  514. ($(proxyport%))
  515.    r$=
  516.    proxyonoff=
  517.  proxyonoff 
  518. iconstate(config%,23,1)
  519.    $(headline%(8))=
  520.    autoadjust=
  521.  autoadjust 
  522. iconstate(config%,28,1)
  523.    iconbar=
  524.    leftwindow=
  525.    topwindow=
  526.    beep=
  527.  beep 
  528. iconstate(config%,30,1)
  529.    lowgraphics=
  530.  lowgraphics 
  531. iconstate(config%,29,1)
  532.    colour=
  533.  colour<0 
  534.  colour>15 
  535.  colour=15         
  536. load_headlines
  537. load_headlines
  538.  a,b,r$
  539. ("<ticker$dir>.headline")
  540.       r$=
  541.  b=0 
  542.      $(headline%(b))=
  543. save_config
  544.  a, b, i
  545. ("<ticker$dir>.choices")
  546. (tempspeed/2)
  547. "    b=
  548. geticonstate(config%,7)
  549. #    b=
  550. geticonstate(config%,32)
  551. (b)       
  552. (tempupdate)
  553.  i=1 
  554. &    b+=
  555. geticonstate(config%,11+i)
  556.  i=1 
  557. 4    
  558.  channel(i)=
  559. geticonstate(config%,11+i)
  560. (channel(i))
  561. (windowwidth)
  562. #a,$(proxyhost%)
  563. #a,$(proxyport%)
  564. #    b=
  565. geticonstate(config%,23)
  566. #a,$(headline%(8))
  567. #    b=
  568. geticonstate(config%,28)
  569. (iconbar)
  570.    !b%=main%
  571.  "Wimp_GetWindowState",,b%
  572. (b%!4)
  573. (b%!16)
  574. "   b=
  575. geticonstate(config%,30)
  576. "   b=
  577. geticonstate(config%,29)
  578.  colour  
  579. load_config
  580. load_templates
  581.  "Wimp_OpenTemplate",,"<ticker$Dir>.Templates"
  582.  "Wimp_LoadTemplate",,b%,ws%,wsend%,-1,"main", 0 
  583.  ,,ws%
  584. message%(0)=b%!(108+(32*0))
  585. message%(1)=b%!(108+(32*1))
  586. message%(2)=b%!(108+(32*2))
  587. message%(3)=b%!(108+(32*3))
  588. message%(4)=b%!(108+(32*4))
  589. message%(5)=b%!(108+(32*5))
  590. message%(6)=b%!(108+(32*6))
  591.  "Wimp_CreateWindow",,b% 
  592.  main%
  593.  "Wimp_LoadTemplate",,b%,ws%,wsend%,-1,"Info", 0 
  594.  ,,ws%
  595.  "Wimp_CreateWindow",,b% 
  596.  infobox%
  597.  "Wimp_LoadTemplate",,b%,ws%,wsend%,-1,"config", 0 
  598.  ,,ws%
  599. speed%=b%!(108+(32*21))
  600. update%=b%!(108+(32*6))
  601.  i=0 
  602. #headline%(i)=b%!(108+32*(i+12))
  603. proxyhost%=b%!(108+(32*24))
  604. proxyport%=b%!(108+(32*25))
  605.  "Wimp_CreateWindow",,b% 
  606.  config%
  607.  "Wimp_LoadTemplate",,b%,ws%,wsend%,-1,"message", 0 
  608.  ,,ws%
  609.  "Wimp_CreateWindow",,b% 
  610.  resolver%
  611.  "Wimp_CloseTemplate"
  612.  ** resize icons **
  613.  i=0 
  614.  SYS "Wimp_ResizeIcon",main%,i,132,-49,132,-3
  615. >             
  616.    SYS "Wimp_ResizeIcon",main%,i,x,-49,xx,-3
  617. +                      b%!0=main%:b%!4=i
  618. '         
  619.  "Wimp_GetIconState",,b%
  620. +               
  621.  "Wimp_DeleteIcon",,b%
  622. 1                b%!4=main%:b%!8=132:b%!16=132
  623. -               
  624.  "Wimp_CreateIcon",,b%+4
  625. colourchange
  626.  icon
  627.  "Wimp_GetPointerInfo",,b%
  628. icon=b%!16
  629.  icon>-1 
  630.  icon <8 
  631.  icon<>7 
  632.  icon<>blue 
  633.  clickable(icon) 
  634. makeblue(icon)
  635.  blue<>7 
  636.  clickable(blue) 
  637. makeblack(blue)
  638.    blue=icon
  639. makeblue(i)
  640.         b%!0=main%:b%!4=i
  641. )           
  642.  "Wimp_GetIconState",,b%
  643. #           b%!8=colour*&1000000
  644.            b%!12=&F000000
  645. )           
  646.  "Wimp_SetIconState",,b%
  647. makeblack(i)
  648.  i<0 
  649.  i>6 
  650.         b%!0=main%:b%!4=i
  651.  )           
  652.  "Wimp_GetIconState",,b%
  653.            b%!8=&7000000
  654.            b%!12=&F000000
  655. #)           
  656.  "Wimp_SetIconState",,b%
  657. mouseclick
  658.  b%!12 
  659.  main%:
  660.  b%!8 
  661. *.    
  662. showmenu(tickermenu%,!b%-64,b%!4)
  663.  4:i=b%!16:
  664. ,Z        
  665.  7:b%!0=main%:b%!4=1:b%!8=10:b%!12=10:b%!16=50:b%!20=50:
  666.  "Wimp_DragBox",,b%
  667.         
  668.         
  669.  i<>7 
  670. /+           a$=
  671. geticontext(main%,b%!16)
  672.            
  673. load_url(a$)
  674.         
  675.  1:i=b%!16:
  676.          
  677. toggle
  678.          
  679. 5          
  680.  i<>7 
  681.  dragging=
  682. 6S         b%!0=main%:b%!4=2:b%!8=0:b%!12=0:b%!16=0:b%!20=0:
  683.  "Wimp_DragBox",,b%
  684.          
  685.  config%:
  686.  b%!16 
  687. :5       
  688.  3:b%!0=config%:
  689.  "Wimp_CloseWindow",,b%
  690. ;B       
  691. save_config:b%!0=config%:
  692.  "Wimp_CloseWindow",,b%
  693.        
  694.  tempspeed>2 
  695.  tempspeed-=2:$(speed%)=
  696. (tempspeed/2):b%!0=config%:b%!4=21:b%!8=0:b%!12=0:
  697.  "Wimp_SetIconState",,b%
  698.        
  699.  tempspeed<20 
  700.  tempspeed+=2:$(speed%)=
  701. (tempspeed/2):b%!0=config%:b%!4=21:b%!8=0:b%!12=0:
  702.  "Wimp_SetIconState",,b%
  703.        
  704.  tempupdate >1 
  705.  tempupdate-=1:$(update%)="Every "+
  706. (tempupdate)+" mins.":b%!0=config%:b%!4=6:b%!8=0:b%!12=0:
  707.  "Wimp_SetIconState",,b%
  708.        
  709.  tempupdate <60 
  710.  tempupdate+=1:$(update%)="Every "+
  711. (tempupdate)+" mins.":b%!0=config%:b%!4=6:b%!8=0:b%!12=0:
  712.  "Wimp_SetIconState",,b%
  713.        
  714. proxy_shade
  715.        
  716. update_shade
  717. B3       
  718.  27: 
  719. "Filer_OpenDir <ticker$dir>.help"
  720. proxy_shade
  721. geticonstate(config%,23)
  722.  i=24 
  723. iconshade(config%,i,
  724. update_shade
  725. geticonstate(config%,7)
  726. iconshade(config%,6,
  727. iconshade(config%,10,
  728. iconshade(config%,11,
  729. iconshade(config%,32,
  730. load_url(a$)
  731. a$,x2-5)
  732. ("<ticker$dir>.story2")
  733. #y2=0
  734.   x2$=
  735. x2$,8)="HEADLINE" 
  736.      x2=
  737.      x2$=
  738. x2$,x2-9)
  739.  x2=t2 
  740.  x2$=a$
  741.  x2$=a$ 
  742.   x2$=
  743.   t2=
  744.   x2$=
  745. x2$,t2-4)
  746.  x2$<>"" 
  747. launch_url(x2$,1)
  748. ticker_update
  749. sysvar("Ticker$Update","0")
  750.  Shit! Time to update the ticker
  751.  we ARE NOT connected, honest
  752.  "OS_ReadMonotonicTime" 
  753.  time%
  754. connectstatus=0
  755. position=0
  756. init_sockets
  757. connectstatus=1
  758.  mtresolv 
  759. open_resolver_window
  760. open_resolver_window
  761. b%!0=resolver%
  762.  "Wimp_GetWindowState",,b%
  763. ~%b%!4=modewidth-196:b%!12=b%!4+392
  764. %b%!8=modeheight-96:b%!16=b%!8+192
  765.  "Wimp_OpenWindow",,b%
  766. launch_url(a$,do)
  767.  hi%, len%, temp$
  768. !b%!0=256:b%!12=0:b%!16=&4AF80
  769.  lowgraphics 
  770.  hi%=
  771. a$,"/hi/"):len%=
  772.  temp$=
  773. a$,len%-(len%-hi%)-1)
  774. temp$+="/low/"
  775. temp$+=
  776. a$,len%-hi%-3)
  777. a$=temp$
  778. $(b%+20)=a$+
  779.  "Wimp_SendMessage",18,b%,0,0
  780. launched$=a$
  781. menuclick
  782. c%=b%+900
  783.  "Wimp_GetPointerInfo",,c%
  784. adj%=(c%!8 
  785.  "Wimp_DecodeMenu",,topmenu%,b%,c%
  786.  $c% 
  787.  "Quit":quit%=
  788.  "Update Now":
  789. ticker_update
  790.  "The BBC":
  791. launch_url("http://www.bbc.co.uk/",0)
  792.  "News Online":
  793. launch_url("http://news.bbc.co.uk",0)
  794.  "Updates...":
  795. launch_url("http://www.geocities.com/Paris/Lights/7724",0)
  796.  "Choices":
  797. update_choices
  798.  adj% 
  799. showmenu(topmenu%,topx%,topy%)
  800. update_choices
  801.  c%=1 
  802. iconstate(config%,c%+11,-channel(c%))
  803. $(speed%)=
  804. (speed/2)
  805. *$(update%)="Every "+
  806. (update)+" mins."
  807. $(proxyport%)=
  808. (tempport)
  809. $(proxyhost%)=temphost$
  810. iconstate(config%,23,proxyonoff)
  811. iconstate(config%,28,autoadjust)
  812. iconstate(config%,30,beep)
  813. iconstate(config%,29,lowgraphics)
  814. proxy_shade
  815. update_shade
  816. E!b%=config%:
  817.  "Wimp_GetWindowState",,b%:
  818.  "Wimp_OpenWindow",,b%
  819.  ---- menu stuff ----
  820. make_menu
  821. start%=menspc%
  822.  title$
  823. $(start%)=title$
  824. start%?12=7
  825. start%?13=2
  826. start%?14=7
  827. start%?15=0
  828. start%!20=44
  829. start%!24=0
  830. width%=
  831. (title$)-3
  832. menspc%+=28
  833.  item$
  834.  item$<>"*" 
  835. !menspc%=0
  836. writeable%=
  837. item$,"_")
  838.  ul% 
  839. tail$=
  840. item$,
  841. (item$)-ul%)
  842. tail$,"T") !menspc%=!menspc% 
  843. tail$,"D") !menspc%=!menspc% 
  844. tail$,"W") !menspc%=!menspc% 
  845.  4:writeable%=
  846.  buffer%:
  847.  buflen%
  848. tail$,"M") !menspc%=!menspc% 
  849. item$=
  850. item$,ul%-1)
  851.  item$>width% width%=
  852.  item$
  853. menspc%!4=-1
  854.  writeable% 
  855. Zmenspc%!8=&0700F121:menspc%!12=buffer%:menspc%!16=-1:menspc%!20=buflen%:$buffer%=item$
  856.  item$<12 
  857. +menspc%!8=&07000021:$(menspc%+12)=item$
  858. Imenspc%!8=&0700F121:menspc%!12=ws%:mwnspc%!16=-1:menspc%!20=
  859.  item$+1
  860. $ws%=item$:ws%+=
  861.  item$+1
  862. menspc%+=24
  863.  item$="*"
  864. start%!16=width%*16+32
  865. %!(menspc%-24)=!(menspc%-24) 
  866. mptr%=menspc%
  867. =start%
  868. attach(menu%,item%,sub%)
  869. !(menu%+28+item%*24+4)=sub%
  870. showmenu(menu%,x%,y%)
  871. $topmenu%=menu%:topx%=x%:topy%=y%
  872.  "Wimp_CreateMenu",,menu%,x%,y%
  873. ticker_menu
  874.  Ticker,Info,Choices,Update Now,Quit_D,The BBC,News Online,Updates...,*
  875. tickermenu%=
  876. make_menu
  877. geticonstate(win%,icon%)
  878. 2!b%=win%:b%!4=icon%:
  879.  "Wimp_GetIconState",,b%
  880. =(b%!24>>21 
  881.  1)>0
  882. iconstate(win%,icon%,type%)
  883.  s%,t%
  884.  type% 
  885.  0:s%=0<<21:t%=1<<21
  886.  -1,1:s%=1<<21:t%=1<<21
  887.  2:s%=1<<21:t%=0<<21
  888. )b%!0=win%:b%!4=icon%:b%!8=s%:b%!12=t%
  889.  "Wimp_SetIconState",,b%
  890. iconshade(win%,icon%,type%)
  891.  s%,t%
  892.  type% 
  893.  0:s%=0<<22:t%=1<<22
  894.  -1,1:s%=1<<22:t%=1<<22
  895.  2:s%=1<<22:t%=0<<22
  896. )b%!0=win%:b%!4=icon%:b%!8=s%:b%!12=t%
  897.  "Wimp_SetIconState",,b%
  898. geticontext(win%,icon%)
  899. 3b%!0=win%:b%!4=icon%:
  900.  "Wimp_GetIconState",,b%
  901.  ((b%!24) 
  902.  &100)=0 
  903. string0(b%+28)
  904. string0(b%!28)
  905. string0(a%):
  906.  a%=0 
  907. ?a%>31 
  908. (a$)<255:a$=a$+
  909. ?a%:a%=a%+1:
  910. sysvar(var$,val$)
  911.  "OS_SetVarVal",var$,val$,
  912.  val$,0,0
  913. sysvar(var$)
  914.  len%,val$,F%
  915.  "XOS_ReadVarVal",var$,b%,256,0,0 
  916.  ,,len%;F%
  917.  len%=0
  918. b%?len%=13
  919.